<template>
  <div class="main">
    <div class="classify">
      <Title title  ='地产分类' icon='el-icon-s-home'></Title>
      <Content :data='categoryList' route='/list' category='category' ></Content>
    </div>
  </div>
</template>

<script>
import Title from '@/components/title'
import Content from '@/components/content'
import {categoryList} from '@/api/category'
export default {
  components:{Title,Content},
  data(){
    return{
      categoryList:[]
    }
  },
  async created(){
    // 获取房产分类数据
      let {data} = await categoryList()
      this.categoryList = data
  },
  methods:{
    // 点击跳转路由 并在路由带上参数
    categoryDetailList(id){
      this.$router.push({
        path:'/list',
        query:{
          category:id
        }
      })
    }
  }
};
</script>

<style lang="less" scoped>
.main {
  padding-bottom: 20px;
}

</style>